/*
 * IDA.h
 *
 *  Created on: May 18, 2011
 *      Author: federico
 */

#ifndef IDA_H_
#define IDA_H_

#include "../datastructures/FifteenPuzzleNodeIDA.h"
#include "../heuristics/Manhattan15Puzzle.h"
#include "../heuristics/PDBHeuristic.h"
#include <iostream>

#define Manhattan 0
#define PDB 1
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))

class IDA {
public:

	IDA();
	IDA(FifteenPuzzleNodeIDA So, Manhattan15Puzzle *manhattanCalculator);
	IDA(FifteenPuzzleNodeIDA So, PDBHeuristic *fpdb, PDBHeuristic *spdb, PDBHeuristic *tpdb);
	virtual ~IDA();
	void Driver();
	int DFSIDA(char prev, int t);
	inline void swap(int i, int j);

	FifteenPuzzleNodeIDA GlobalNode;
	Manhattan15Puzzle *manhattanCalculator;
	PDBHeuristic *fpdb;
	PDBHeuristic *spdb;
	PDBHeuristic *tpdb;
	int moves;
	int heuristic;
};

#endif /* IDA_H_ */
